<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let str = "Janine哈哈，美好的一天要End了";
        str = str.replace(/[a-zA-Z]/g, content => {
            return content.toUpperCase() === content ? content.toLowerCase() : content.toUpperCase();
        })
        console.log(str);
    </script>
</body>

</html>